load("//tools:defaults.bzl", "angular_jasmine_test", "ng_web_test_suite", "ts_project")

# Test that should only be run in node
NODE_ONLY = [
    "**/*_node_only_spec.ts",
]

ts_project(
    name = "test_lib",
    testonly = True,
    srcs = glob(
        ["**/*.ts"],
        exclude = NODE_ONLY,
    ),
    deps = [
        "//:node_modules/source-map",
        "//packages/common",
        "//packages/compiler",
        "//packages/compiler/test/expression_parser/utils",
        "//packages/compiler/test/ml_parser/util",
        "//packages/core",
        "//packages/core/src/compiler",
        "//packages/core/testing",
        "//packages/platform-browser",
        "//packages/platform-browser-dynamic",
        "//packages/platform-browser/testing",
        "//packages/private/testing",
    ],
)

ts_project(
    name = "test_node_only_lib",
    testonly = True,
    srcs = glob(
        NODE_ONLY,
    ),
    deps = [
        ":test_lib",
        "//:node_modules/typescript",
        "//packages/compiler",
        "//packages/compiler/test/expression_parser/utils",
        "//packages/core",
    ],
)

angular_jasmine_test(
    name = "test",
    data = [
        ":test_lib",
        ":test_node_only_lib",
        "//:node_modules/source-map",
    ],
)

ng_web_test_suite(
    name = "test_web",
    deps = [
        ":test_lib",
    ],
)
